<div class="slide-dialog-header">
	<h2>{{title}}</h2>
	<div class="slide-dialog-toolbar">
		<ul>
			<li><span class="ui-btn slide-dialog-close" ng-click="close(false)"><i class="fa fa-remove"></i></span></li>
		</ul>
	</div>
</div>
<div class="slide-dialog-body x-slide-dialog-body">
	<div class="x-data-panel-fixed">
		<form name="form" novalidate="novalidate" ng-submit="submit(form.$valid);">
			<div class="x-data-panel-body">
				<div class="data-form">
					<table cellspacing="0" cellpadding="0">
						<colgroup>
							<col width="110" />
						</colgroup>
						<tbody>
							<tr>
								<td class="x-control"><span class="x-star">*</span>数据源名称：</td>
								<td>
									<input type="text" name="name" ng-model="data.name" class="x-ipt" placeholder="请输入数据源名称" required ng-maxlength="50" remote="{name: 'database_check_name', params: {id: data.id}}"/>
									<div class="x-error" ng-if="interacted(form.name)" ng-messages="form.name.$error">
		                                <span ng-message="required">数据源名称不能为空</span>
		                                <span ng-message="maxlength">数据源名称长度过长</span>
		                                <span ng-message="remote">数据源名称已存在</span>
		                            </div>
								</td>
							</tr>
							<tr>
								<td class="x-control"><span class="x-star">*</span>数据库名称：</td>
								<td>
									<input type="text" name="database" ng-model="data.dbName" class="x-ipt" placeholder="请输入数据库名称" required ng-maxlength="50" />
									<div class="x-error" ng-if="interacted(form.database)" ng-messages="form.database.$error">
		                                <span ng-message="required">数据库名称不能为空</span>
		                                 <span ng-message="maxlength">数据库名称长度过长</span>
		                            </div>
								</td>
							</tr>
							<tr>
								<td>数据源描述：</td>
								<td><textarea ng-model="data.dbDesc" name="desc" class="x-ipt" ng-maxlength="255" rows="8" placeholder="请输入数据源描述"></textarea>
									<div class="x-error" ng-if="interacted(form.desc)" ng-messages="form.desc.$error">
		                                 <span ng-message="maxlength">数据源描述长度过长</span>
		                            </div>
								</td>
							</tr>
							<tr>
								<td class="x-control">数据驱动：</td>
								<td><select ng-model="data.connType" ng-init="data.connType = connTypes[0].id" ng-options="conn.id as conn.value for conn in connTypes">
								</select></td>
							</tr>
							<tr>
								<td class="x-control"><span class="x-star">*</span>连接字符串：</td>
								<td>
									<p><input type="text" name="conn" ng-maxlength="100" ng-model="data.jdbcUrl" class="x-ipt" placeholder="请输入连接串" required /></p>
									<p class="x-error" ng-if="interacted(form.conn)" ng-messages="form.conn.$error">
										<span ng-message="required">连接串不能为空</span>
										<span ng-message="maxlength">连接串长度过长</span>
									</p>
									<p class="x-label">注：jdbc:mysql://{host}:{port}/{dbName}</p>
								</td>
							</tr>
							<!-- <tr>
								<td class="x-control"><span class="x-star">*</span>数据库表：</td>
								<td>
									<input type="text" name="table" ng-model="data.table" class="x-ipt" placeholder="请输入表名" required />
									<div class="x-error" ng-if="interacted(form.table)" ng-messages="form.table.$error">
		                                <span ng-message="required">表名不能为空</span>
		                            </div>
								</td>
							</tr> -->
							<tr>
								<td class="x-control"><span class="x-star">*</span>用户名：</td>
								<td>
									<input type="text" name="username" ng-maxlength="50" ng-model="data.userName" class="x-ipt" placeholder="请输入用户名" required />
									<div class="x-error" ng-if="interacted(form.username)" ng-messages="form.username.$error">
		                                <span ng-message="required">用户名不能为空</span>
		                                 <span ng-message="maxlength">用户名长度过长</span>
		                            </div>
								</td>
							</tr>
							<tr>
								<td class="x-control"><span class="x-star">*</span>密码：</td>
								<td>
									<input type="password" name="password" ng-maxlength="50" ng-model="data.userPwd" class="x-ipt" placeholder="请输入密码" required />
									<div class="x-error" ng-if="interacted(form.password)" ng-messages="form.password.$error">
		                                <span ng-message="required">密码不能为空</span>
		                                <span ng-message="maxlength">密码长度过长</span>
		                            </div>
								</td>
							</tr>
						</tbody>
					</table>
					<!-- <dl>
						<dt><span class="x-star">*</span>数据源名称：</dt>
						<dd>
							<input type="text" name="name" ng-model="data.name" class="x-ipt" placeholder="请输入数据源名称" required />
							<div class="x-error" ng-if="interacted(form.name)" ng-messages="form.name.$error">
                                <span ng-message="required">数据源名称不能为空</span>
                            </div>
						</dd>
					</dl>
					<dl>
						<dt><span class="x-star">*</span>数据库名称：</dt>
						<dd>
							<input type="text" name="database" ng-model="data.database" class="x-ipt" placeholder="请输入数据库名称" required />
							<div class="x-error" ng-if="interacted(form.database)" ng-messages="form.database.$error">
                                <span ng-message="required">数据库名称不能为空</span>
                            </div>
						</dd>
					</dl>
					<dl>
						<dt>数据源描述：</dt>
						<dd><textarea ng-model="data.desc" class="x-ipt" rows="8" placeholder="请输入数据源描述"></textarea></dd>
					</dl>
					<dl>
						<dt>数据源驱动：</dt>
						<dd><select ng-model="data.driver"><option value="">请选择</option><option value="1">Mysql</option></select></dd>
					</dl>
					<dl>
						<dt><span class="x-star">*</span>连接串：</dt>
						<dd>
							<input type="text" name="conn" ng-model="data.conn" class="x-ipt" placeholder="请输入连接串" required />
							<div class="x-error" ng-if="interacted(form.conn)" ng-messages="form.conn.$error">
                                <span ng-message="required">连接串不能为空</span>
                            </div>
						</dd>
					</dl>
					<dl>
						<dt><span class="x-star">*</span>用户名：</dt>
						<dd>
							<input type="text" name="username" ng-model="data.username" class="x-ipt" placeholder="请输入用户名" required />
							<div class="x-error" ng-if="interacted(form.username)" ng-messages="form.username.$error">
                                <span ng-message="required">用户名不能为空</span>
                            </div>
						</dd>
					</dl>
					<dl>
						<dt><span class="x-star">*</span>密码：</dt>
						<dd>
							<input type="password" name="password" ng-model="data.password" class="x-ipt" placeholder="请输入密码" required />
							<div class="x-error" ng-if="interacted(form.password)" ng-messages="form.password.$error">
                                <span ng-message="required">密码不能为空</span>
                            </div>
						</dd>
					</dl> -->
				</div>
			</div>
			<div class="x-data-panel-footer">
				<button class="dialog-button cancel-button" type="button" ng-click="close(false)">取消</button><button class="dialog-button" type="submit" ng-disabled="formDisabled">提交</button>
			</div>
		</form>
	</div>
</div>